/*
	Simple Software Renderer (SSRenderer)
	Copyright (C) 2007 Piotr Orzechowski <piotr.orzechowski@gmail.com>

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef _SRRTYPES_H
#define _SRRTYPES_H

namespace ssr
{

/** 8 bit unsigned variable. */
typedef unsigned char u8;

/** 8 bit signed variable. */
typedef signed char	s8;

/** 8 bit character variable. */
typedef char c8;

/** 16 bit unsigned variable. */
typedef unsigned short u16;

/** 16 bit signed variable. */
typedef signed short s16;

/** 32 bit unsigned variable. */
typedef unsigned int u32;

/** 32 bit signed variable. */
typedef signed int s32;

/** 32 bit floating point variable. */
typedef float f32;

/** 64 bit floating point variable. */
typedef double f64;

/** Structure representing a 32-bit color. */
struct color32
{
	union
	{
		struct
		{
			u8 b, g, r, a;
		};
		u32 argb;
	};

	inline color32()
	{
	}

	inline color32(u32 color)
	{
		b = (color) & 0xFF;
		g = (color >> 8) & 0xFF;
		r = (color >> 16) & 0xFF;
		a = (color >> 24);
	}

	inline operator u32() const
	{
		return argb;
	}
};

} // namespace

#endif
